package com.yuxiang.flowable.result;

/**
 * @author : yx-0176
 * @description
 * @date : 2022/3/9
 */
public class CommonResult<T> extends BaseResult {
    private T data;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public static <T> CommonResult<T> buildData(T data){
        CommonResult<T> result = new CommonResult<>();
        result.setData(data);
        result.setSuccess(true);
        result.setCode(ResultCode.SUCCESS.getCode());
        result.setMessage(ResultCode.SUCCESS.getMessage());
        return result;
    }

}
